#!/bin/bash

[ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0

tname=$(mktemp -d cgclean.XXXXXX)
mount -t cgroup none $tname -o "devices"

echo "Cleaning $tname"
set +e
rmdir "$tname/zdtmtst/special_prop_check"
rmdir "$tname/zdtmtst"
set -e

umount "$tname"
rmdir "$tname"
